//教育
layui.config({
	base : "js/data/"
}).use(['allApi'],function(){
	var allApi = layui.allApi;
	//获取所有分类
	allApi.dataListF(allApi.education_cat+"?type=UserLecturer","data-cat","cat-list");
	//初始化获取不同数据
	var ulList=$(".education-list");
	ulList.each(function(){
		var catId=$(this).attr("data-id");
		allApi.dataListLoad(catId,"#user-item"+catId,allApi.lecturer,"data-list");
	})
	//切换分类
	$(document).on("click",".slide",function(){
		if(!$(this).hasClass("active")){
			$(".slide").removeClass("active");
            $(".add-active").removeClass("now");
            $(this).addClass("active");
            $(this).children().addClass("now");
			var id=$(this).attr('data-id');
			$(".education-list").hide();
			$("#user-item"+id).show();
		}
	})
	allApi.linkEvent("#user-list","li");
	var mySwiper = new Swiper('.swiper-container', {
		slidesPerView: '4.8',
		onTransitionEnd: function(swiper) {
			if(swiper.progress == 1) {
				swiper.activeIndex = swiper.slides.length - 1
			}
		}
	})
})

	